home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / dkbsrc.zip / IBMCONF.H < prev    next >
C/C++ Source or Header  |  1991-05-04  |  5KB  |  138 lines

  1. /*****************************************************************************
  2. *
  3. *                                   ibmconf.h
  4. *
  5. *   from DKBTrace (c) 1990  David Buck
  6. *
  7. *  This file contains ibm-specific defines, types, etc.
  8. *
  9. * This software is freely distributable. The source and/or object code may be
  10. * copied or uploaded to communications services so long as this notice remains
  11. * at the top of each file.  If any changes are made to the program, you must
  12. * clearly indicate in the documentation and in the programs startup message
  13. * who it was who made the changes. The documentation should also describe what
  14. * those changes were. This software may not be included in whole or in
  15. * part into any commercial package without the express written consent of the
  16. * author.  It may, however, be included in other public domain or freely
  17. * distributed software so long as the proper credit for the software is given.
  18. *
  19. * This software is provided as is without any guarantees or warranty. Although
  20. * the author has attempted to find and correct any bugs in the software, he
  21. * is not responsible for any damage caused by the use of the software.  The
  22. * author is under no obligation to provide service, corrections, or upgrades
  23. * to this package.
  24. *
  25. * Despite all the legal stuff above, if you do find bugs, I would like to hear
  26. * about them.  Also, if you have any comments or questions, you may contact me
  27. * at the following address:
  28. *
  29. *     David Buck
  30. *     22C Sonnet Cres.
  31. *     Nepean Ontario
  32. *     Canada, K2H 8W7
  33. *
  34. *  I can also be reached on the following bulleton boards:
  35. *
  36. *     OMX              (613) 731-3419
  37. *     Mystic           (613) 596-4249  or  (613) 596-4772
  38. *
  39. *  Fidonet:   1:163/109.9
  40. *  Internet:  dbuck@ccs.carleton.ca
  41. *  The "You Can Call Me RAY" BBS    (708) 358-5611
  42. *
  43. *  IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
  44. *
  45. *     The "You Can Call Me RAY" BBS (708) 358-5611
  46. *     The Information Exchange BBS  (708) 945-5575
  47. *
  48. *****************************************************************************/
  49.  
  50.  
  51. /* The following defines may be added when porting to other systems or
  52.    other compilers.  The defaults are shown here:
  53.  
  54.  
  55.    #define PARAMS(x) x                   - use 'x' for ANSI, '()' for non ANSI
  56.    #define EPSILON 1.0e-5                - a small value used for quartics
  57.    #define FILE_NAME_LENGTH 150          - default file name length
  58.    #define DBL double                    - floating point precision
  59.    #define HUGE_VAL 1.0e+17              - a really big number
  60.    #define DBL_FORMAT_STRING "%lf"       - the string to use for scanfs of doubles
  61.    #define DEFAULT_OUTPUT_FORMAT  'd'    - the default +f format
  62.    #define TEST_ABORT                    - code to test for ^C or abort
  63.                                            (called on each pixel)
  64.    #define RED_RAW_FILE_EXTENSION ".red" - for +fr, this is the extension for the
  65.                                            red file
  66.    #define GREEN_RAW_FILE_EXTENSION ".grn"  - ditto for the green file
  67.    #define BLUE_RAW_FILE_EXTENSION ".blu"   - ditto again for the blue file
  68.    #define STARTUP_DKB_TRACE             - first executable statement of main
  69.                                            (useful for initialization)
  70.    #define PRINT_OTHER_CREDITS           - used for people who extend dkbtrace.
  71.                                            (put your own printf's here)
  72.    #define FINISH_DKB_TRACE              - last statement before exiting normally
  73.    #define FILENAME_SEPARATOR "/"        - the character that separates names
  74.                                            in a path.
  75.    #define setvbuf(w,x,y,z)              - some systems don't understand setvbuf.
  76.                                            If not, just define it away - it's
  77.                                            not critical to the raytracer.  It
  78.                                            just buffers disk accesses.
  79. */
  80.  
  81. #include <conio.h>
  82. #include <stdarg.h>
  83. #include <stdlib.h>
  84.  
  85.  
  86. #ifndef TURBOC
  87. void _cdecl main(int, char **);    /* so MSC can use FASTCALL's... */
  88. #define main (_cdecl main)
  89. #define    MK_FP(seg,ofs)    ((void far *)(((unsigned long)(seg) << 16) | (unsigned)(ofs)))
  90. #else
  91. #define _cdecl    cdecl    /* Turbo-C equivalent function names/keywords */
  92. #define _enable    enable
  93. #define _disable disable
  94. #define outpw    outport
  95. #define outp    outportb
  96. #define inp    inportb
  97. #endif
  98.  
  99. #ifdef MATH_CO
  100. #define DBL long double
  101. #else
  102. #define DBL double
  103. #endif
  104.  
  105. #ifdef MATH_CO
  106. #define DBL_FORMAT_STRING "%Lf"
  107. #else
  108. #define DBL_FORMAT_STRING "%lf"
  109. #endif
  110.  
  111. #if defined(MATH_CO) && !defined(TURBOC)
  112. #define ACOS acosl
  113. #define SQRT sqrtl
  114. #define POW powl
  115. #define COS cosl
  116. #define SIN sinl
  117. #define EPSILON 1.0e-15
  118. #else
  119. #define ACOS acos
  120. #define SQRT sqrt
  121. #define POW pow
  122. #define COS cos
  123. #define SIN sin
  124. #define EPSILON 1.0e-5
  125. #endif
  126.  
  127. #define DEFAULT_OUTPUT_FORMAT    't'
  128.  
  129. #define TEST_ABORT if (Options & EXITENABLE) if (kbhit()) { Stop_Flag = TRUE; getch(); }
  130.  
  131. #define RED_RAW_FILE_EXTENSION     ".r8"    /* PICLAB's "RAW" file format */
  132. #define GREEN_RAW_FILE_EXTENSION ".g8"    /* PICLAB's "RAW" file format */
  133. #define BLUE_RAW_FILE_EXTENSION     ".b8"    /* PICLAB's "RAW" file format */
  134.  
  135. #define FILENAME_SEPARATOR "\\"        /* wierd 'ol IBM's like backslashes */
  136.  
  137. #define PARAMS(x) x            /* This gives us ANSI prototyping */
  138.